package ICQ;

import java.util.List;
import java.util.Arrays;

interface C {
    public void f(C c);
}
class A {
    public void f(A a) { System.out.println("fa(A)"); }
    public void f(B b) { System.out.println("fa(B)"); }
}
class B extends A implements C {
    public void f(C c) { System.out.println("fb(C)"); }
    public void f(A a) { System.out.println("fb(A)"); }
    public void f(B b) { System.out.println("fb(B)"); }
}

class TypeMeister {

    public static int minOfProper(List<Integer> list) {
        int min = 10000;

        for (int i = 0; i < list.size(); i++) {
            int element = list.get(i);
            int indexPlusOne = i + 1;

            if (element % indexPlusOne == 0) {
                if (element < min) {
                    min = element;
                }
            }
        }

        return min;
    }

    public static void main(String[] args) {
        List<Integer> list2 = Arrays.asList(10, 25);
        System.out.println(minOfProper(list2));

//        A a = new A();
//        B b = new B();
//        A ab = (A)b;
//        C cb = (C)b;
//
////        a.f(a);
////        b.f(cb);
//        b.f(b);




    }
}
